// {
//   "total": 5,
//   "items": [
//     {
//       "id": "1585819467649851393",
//       "gmtCreate": "2022-10-28 10:23:19",
//       "gmtModified": "2022-10-28 10:23:19",
//       "deleted": false,
//       "username": "xtest22",
//       "password": "e80fe5c5a4c3700edf23f76268f065bc",
//       "nickName": "xtest22",
//       "salt": null,
//       "token": null,
//       "roleName": ""
//     }
//   ]
// }

export interface UserItem {
  id: string;
  gmtCreate: string; //创建时间
  gmtModified: string; //更新时间
  // deleted: false;
  username: string; //用户名称
  // password: string;
  nickName: string; //用户昵称
  // salt: null;
  // token: null;
  roleName: string; //角色列表
}

export type UserList = UserItem[];

export interface getUserListResponse {
  total: number;
  items: UserList;
}
//pick  保留需要的   omit  过滤不需要的
export interface SaveUserParams
  extends Pick<UserItem, "username" | "nickName"> {
  password: string;
}
//角色数据
/* {
  "assignRoles": [],
  "allRolesList": [
    {
      "id": "1",
      "gmtCreate": "2022-01-01 00:00:00",
      "gmtModified": "2022-01-01 00:00:00",
      "deleted": false,
      "roleName": "平台管理员",
      "remark": null
    },
  ]
}*/
export interface RoleItem {
  id: string;
  gmtCreate: string;
  gmtModified: string;
  roleName: string;
  // deleted: false;
  // remark: null;
}

export type RoleList = RoleItem[];

export interface GetUserRoleListResponse {
  assignRoles: RoleList;
  allRolesList: RoleList;
}
